/**
 *  Filename: GSMReading.java (in org.repin.base.core.measure)
 *  This file is part of the Redpin project.
 * 
 *  Redpin is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as published
 *  by the Free Software Foundation, either version 3 of the License, or
 *  any later version.
 *
 *  Redpin is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with Redpin. If not, see <http://www.gnu.org/licenses/>.
 *
 *  (c) Copyright ETH Zurich, Pascal Brogle, Philipp Bolliger, 2010, ALL RIGHTS RESERVED.
 * 
 *  www.redpin.org
 */
package ch.simplix.android.net.discoverer.gsm;


/**
 * Describes a GSM reading
 * 
 * @author Philipp Bolliger (philipp@bolliger.name)
 * @author Simon Tobler (simon.p.tobler@gmx.ch)
 * @author Pascal Brogle (broglep@student.ethz.ch)
 * @author Reto Koenig
 * @version 0.3
 */
public class GSMReading {



	/* attributes */
	protected String mobileCountryCode=""; 
	protected String cellId = "";
	protected String areaId = "";
	protected int signalStrength ;
	private int networkType;


	public void setMCC(String mCC) {
		mobileCountryCode = mCC;
	}
	public String getMCC() {
		return mobileCountryCode;
	}

	/**
	 * @return the cellId
	 */
	public String getCellId() {
		return cellId;
	}

	/**
	 * @param cellId
	 *            the cellId to set
	 */
	public void setCellId(String cellId) {
		this.cellId = cellId;
	}

	/**
	 * @return the areaId
	 */
	public String getAreaId() {
		return areaId;
	}

	/**
	 * @param areaId
	 *            the areaId to set
	 */
	public void setAreaId(String areaId) {
		this.areaId = areaId;
	}

	/**
	 * @return the signalStrength
	 */
	public int getSignalStrength() {
		return signalStrength;
	}

	/**
	 * @param signalStrength
	 *            the signalStrength to set
	 */
	public void setSignalStrength(int signalStrength) {
		this.signalStrength = signalStrength;
	}
	public void setNetworkType(int networkType) {
		this.networkType = networkType;
	}
	public int getNetworkType() {
		return networkType;
	}


	@Override
	public String toString() {
		return "MCC=" + mobileCountryCode+"|AreaID=" + areaId + "|CellID=" + cellId + "|RSSI =" + signalStrength+"|Network ="+networkType;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((areaId == null) ? 0 : areaId.hashCode());
		result = prime * result + ((cellId == null) ? 0 : cellId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		GSMReading other = (GSMReading) obj;
		if (areaId == null) {
			if (other.areaId != null)
				return false;
		} else if (!areaId.equals(other.areaId))
			return false;
		if (cellId == null) {
			if (other.cellId != null)
				return false;
		} else if (!cellId.equals(other.cellId))
			return false;
		return true;
	}

	
}
